<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>vote</title>
		<!--<link rel="stylesheet" href="css/vote.css" />-->
	</head>

	<body  ng-app="myApp" onload="initVote();canvasOnload();">
		<div ng-controller="votesCtrl">
			<div id="vote" style="display:none">
				<form name="choiceForm">
					您最喜欢水果？<br/><br/>
					<div class="vote" ng-repeat="vote in votes">
						<label><input type="radio" name="test" ng-model="choice.id" ng-value="vote.id"/>{{vote.text}}:{{vote.num}}票</label><br/>
					</div>
					<br/>
					<input type="submit" value="投票" ng-click="submitForm()" />
				</form>
				<br/>
				<form class="voteForm" novalidate name="addForm">
					<input type="text" placeholder="选项名" value="" name="text" ng-model="addChoice.text" required/>
					<input type="submit" value="增加选项" ng-click="addChoiceForm()" ng-disabled="addForm.$invalid" />
				</form>
			</div>
			<div id="voted" style="display:none">
				<form name="choiceForm">
					统计结果<br/><br/>
					<div class="vote" ng-repeat="vote in votes | orderBy:'-num'">
						<label>{{vote.text}} :{{vote.num}}票</label><br/>
					</div>
					<br/>
				</form>
				<br/>
			</div>
		</div>

		<div id="content" ng-controller='commentListCtrl'>
			<div data-reactroot="" class="commentBox">
				<h3>用户评论</h3>
				<div class="commentList">
					<div class="comment" ng-repeat="comment in comments">
						<h4 class="commentAuthor">{{comment.author}}</h4>
						<p>{{comment.text}}</p>
					</div>
				</div>
				<form class="commentForm" novalidate name="myForm">
					<input type="text" placeholder="你的姓名" value="" name="author" ng-model="comment.author" required/>
					<input type="text" placeholder="你要说的话" value="" name="text" ng-model="comment.text" required/>
					<input type="submit" value="提交" ng-click="submitForm()" ng-disabled="myForm.$invalid" />
				</form>
			</div>
		</div>
		<script src="scripts/angular.min.js"></script>
		<script src="scripts/vote.js"></script>
		<!--<script src="scripts/comment.js"></script>-->
		<script src="scripts/canvas.js"></script>
	</body>

</html>